﻿@model myFinance.Models.GrupoDespesa

@{
	ViewBag.Title = "Cadastro de Grupo de Despesa";
}

<!DOCTYPE html>

<html>
<head>
    <title>Cadastro Grupo de Despesa</title>
    @if (false)
    {
        <script type="text/javascript" src="../../Scripts/jquery-1.6.4-vsdoc.js"></script>
        <script type="text/javascript" src="../../Scripts/jquery.validate-vsdoc.js"></script>
        <script type="text/javascript" src="../../Scripts/jquery.validate.js"></script>
        <script type="text/javascript" src="../../Scripts/numbers.js"></script>
        <script type="text/javascript" src="../../Scripts/script.js"></script>
    }   
    <style type="text/css">
        #corpo
        {
            height: 500px;
            margin: auto;
            width: 900px;
            padding: 0;
        }
        #Nome
        {
            width: 400px;
        }
    </style>
</head>
<body>
    <div id="corpo">
        @using (Html.BeginForm("CadastroGrupo", "GrupoDespesa", FormMethod.Post))
        {
            @Html.ValidationSummary(true)
            @Html.HiddenFor(model => model.Id)
            @Html.HiddenFor(model => model.PessoaId)
            <div class="editor-label">
                @Html.LabelFor(model => model.Nome, "Nome do Grupo: ")
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Nome, new { @class = "obrigatorio" })
                @Html.ValidationMessageFor(model => model.Nome)
            </div>
            <div class="editor-field" style="float: right; padding-right: 235px; margin-top: 15px;">
                <input type="submit" value="Gravar" />
                <input type="button" value="Cancelar" id="cancelar" />
            </div>
        }
    </div>
    <script type="text/javascript">
        $(function () {
            loadPage();
            hideLoading();
            $('#Nome').focus();
        });
        $('#cancelar').click(function () {
        	showLoading();
        	window.location.href = '@Url.Action("Index", "GrupoDespesa")';
        });
	</script>
</body>
</html>
